import java.io.UnsupportedEncodingException;
import java.util.Arrays;

/**
 * @ClassName Demo10
 * @Description: TODO
 * @Author: MaykkSTAR@163.com
 * @DATE: 2023/3/17
 */
public class Demo10 {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String s01 = "iceWan is 冰哥";
        // byte[] bytes = s01.getBytes("UTF-8");
        byte[] bytes = s01.getBytes("GBK");
        //字节流当中汉字的字符编码是负数值
        System.out.println(Arrays.toString(bytes));

        System.out.println(new String(bytes));//默认字符集
        System.out.println(new String(bytes, "GBK"));
    }
}
